<extend name="public:base" />

<block name="left">
	<div class="mark_bar cl">
		<a href="javascript:history.back(-1);" class="goback fl"><i class="iconfont">&#xe600;</i></a>
		<p>手机验证</p>
	</div>
</block>

<block name="main">
	<if condition="$phone_status neq 1">
		<div class="content">
			<form action="__SELF__" method="post" id="form">
				<input type="hidden" id="sendcodeurl" value="{:url('/uc/safe/send_sms')}" />
				<div class="form">
					<div class="input_form">
						<div class="input_form_bar">
							<p>手机号码</p>
							<input name="phone" id="phone" size="11" maxlength="11" type="tel" autocomplete="off" />
							<div class="cl"></div>
						</div>
						<div class="input_form_bar">
							<p>图形验证码</p>
							<input name="verify" id="verify" class="input_t" value="" size="4" maxlength="4" autocomplete="off" type="text" />
							<img src="{:url('/uc/sign/verify')}" class="verifyimg" onclick="refreshEcode()" />
							<div class="cl"></div>
						</div>
						<div class="input_form_bar">
							<p>短信验证码</p>
							<input name="scode" id="scode" class="input_t" value="" size="6" maxlength="6" autocomplete="off" type="number" />
							<a href="javascript:void(0);" class="send_btm" id="btnSendMsg" onclick="isSendbtm();">获取验证码</a>
							<div class="cl"></div>
						</div>
					</div>
					<div class="wrap">
						<input class="submit" type="submit" value="确定" />
					</div>
				</div>
			</form>
		</div>
		<else/>
		<div class="mark_bar cl">
			<a href="javascript:history.back(-1);" class="goback fl"><i class="iconfont">&#xe600;</i></a>
			<p>更换手机号</p>
		</div>
		<div class="content">
			<div class="center_link_list">
				<ul>
					<li>
						<a href="javascript:movetop('sendMsg_info');" id="sendMsg">
							<span>原手机可收到短信信息</span>
							
							<i class="iconfont arrow_r">&#xe611;</i>
							<i class="fr small a999">{$phone|substr=0,3}****{$phone|substr=-4,4}</i>
							<div class="cl"></div>
						</a>
					</li>
					<li>
						<a href="javascript:movetop('sendMember_info');">
							<span>原手机接收不到短信信息</span>
							<i class="iconfont arrow_r">&#xe611;</i>
							<div class="cl"></div>
						</a>
					</li>
				</ul>
			</div>

			<div id="sendMsg_info" class="openframe hide">
				<div class="mark_bar invest_mark_bar">
					<a href="javascript:;" onclick="movebot('sendMsg_info');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
					<p>验证信息</p>
				</div>
				<div class="openframe_content notpad">
					<p class="small tc">点击“获取验证码”，将发送短信验证码到您的手机</p>
					<p class="slarge tc pt1">{$phone|substr=0,3}****{$phone|substr=-4,4}</p>
					<form action="__URL__/verify_phone" method="post" id="verifyform">
					<div class="form">
						<div class="input_form">
						<div class="input_form_bar">
							<p>短信验证码</p>
							<input name="scode" id="scode" class="input_t" value="" size="6" maxlength="6" autocomplete="off" type="tel" />
							<a href="javascript:void(0);" class="send_btm" id="btnSendMsg" onclick="sendMmsg()">获取验证码</a>
							<div class="cl"></div>
						</div>
						</div>
						<div class="wrap">
							<input class="submit" type="submit" value="下一步" />
						</div>
					</div>
					<input type="hidden" value="{$phone}" id="phone" name="phone" />
					<input type="hidden" value="1" name="flag" />
					<input type="hidden" id="sendcodeurl" value="{:url('/uc/safe/send_sms')}" />
					<input type="hidden" id="type" value="1" />
					</form>
				</div>
			</div>

			<div id="sendMember_info" class="openframe hide">
				<div class="mark_bar invest_mark_bar">
					<a href="javascript:;" onclick="movebot('sendMember_info');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
					<p>验证个人信息</p>
				</div>
				<div class="openframe_content notpad">
					<p class="small tc">输入账号绑定信息，以确保账号安全</p>
					<form action="__URL__/verify_phone" method="post" id="memberform">
						<input type="hidden" name="flag" value="2" />
						<div class="form">
							<div class="input_form">
								<div class="input_form_bar">
									<p>身份证号</p>
									<input name="idcard" id="idcard" size="18" maxlength="18" type="text" autocomplete="off" />
									<div class="cl"></div>
								</div>
								<div class="input_form_bar">
									<p>绑定银行卡</p>
									<input name="bankcard" id="card_id" class="input_t" value="" size="19" maxlength="19" autocomplete="off" type="number" />
									<div class="cl"></div>
								</div>
							</div>
							<div class="wrap">
								<input class="submit" type="submit" value="下一步" />
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</if>
</block>

<block name="menu"></block>

<block name="js">
<script type="text/javascript" src="__JS__/check.js"></script>
<if condition="$phone_status neq 1">
	<script type="text/javascript">
		$("#form").submit(function() {
			if(!checkPhone()) return false;
			if(!checkVerify()) return false;
			if(!checkPhonecode()) return false;
			return ajax_post($(this));
		});
	</script>
	<else/>
	<script type="text/javascript">
		$("#memberform").submit(function() {
			if(!checkIdcard()) return false;
			if(!checkBankcard()) return false;
			return ajax_post($(this));
		});
		
		$('#verifyform').submit(function(){
			if(!checkPhonecode()) return false;
			
			return ajax_post($(this));
		})

		var sendMmsg = function() {
			sendMobileValidSMSCode();
			movetop('sendMsg_info');
		}
	</script>
</if>
</block>